//模块接口文件，暴露给外部模块使用
import {request} from "./core";
import METHOD from "./methods";
import URL from "./url";

const APIClient = {
  //将对象注入Vue全局
  install(Vue){
    Vue.prototype.$API = this;
  },
/**
 * 
 * @param {*} mobile String
 * @param {*} password  String
 * 
 */
  login(mobile,password){return request(METHOD.POST,URL.LOGIN,{mobile:mobile,pwd:password})},

/**
 * 
 * @param {*} mobile 
 * @param {*} password 
 * @param {*} code 
 * @param {*} nikcname 
 */
  register(mobile,password,code,nikcname){return request(METHOD.POST,URL.REGISTER,{mobile:mobile,pwd:password,code:code,nikcname:nikcname})}

}

export default APIClient;
